package com.hunt.model.app.nuggets;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;


/**
 * @author ww
 * @className
 * @description
 * @date 2020/8/25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class HqStockData implements Comparable<HqStockData>{

    //消息ID
    private String msgId;
    //代码
    private String code;
    //日期
    private String dateTime;
    //是否盘中数据
    private boolean opening;
    //昨天收盘价*10000
    private float preClose;
    //开盘价*10000
    private float open;
    //最新价*10000
    private float newPrice;
    //最高价*10000
    private float high;
    //最低价*10000
    private float low;
    //均价*10000
    private float avgPrice;
    //股数（单位：个股）
    private long vol;
    //成交额*100
    private long money;
    //成交笔数
    private long numTrades;
    //涨跌幅
    private String hlPercent;
    //涨跌额
    private String change;
    //涨跌停 0 卖单 1 买单
    private String BS;


    //买1数量(单位:个)
    private long buyVol1;
    //买2数量(单位:个)
    private long buyVol2;
    //买3数量(单位:个)
    private long buyVol3;
    //买4数量(单位:个)
    private long buyVol4;
    //买5数量(单位:个)
    private long buyVol5;
    
    
    //买1金额*10000
    private double buyPrice1;
    //买2金额*10000
    private double buyPrice2;
    //买3金额*10000
    private double buyPrice3;
    //买4金额*10000
    private double buyPrice4;
    //买5金额*10000
    private double buyPrice5;
    
    
    //卖1数量(单位:个)
    private long sellVol1;
    //卖2数量(单位:个)
    private long sellVol2;
    //卖3数量(单位:个)
    private long sellVol3;
    //卖4数量(单位:个)
    private long sellVol4;
    //卖5数量(单位:个)
    private long sellVol5;
    
    //卖1金额*10000
    private double sellPrice1;
    //卖2金额*10000
    private double sellPrice2;
    //卖3金额*10000
    private double sellPrice3;
    //卖4金额*10000
    private double sellPrice4;
    //卖5金额*10000
    private double sellPrice5;
    //5分钟涨跌幅
    private String fiveHlPercent="0%";

    @Override
    public int compareTo(HqStockData o) {
        Float thisHlPercent = Float.valueOf(this.hlPercent.replaceAll("%", ""));
        Float oHlPercent = Float.valueOf(o.hlPercent.replaceAll("%", ""));
        if (thisHlPercent - oHlPercent > 0){
            return 1;
        }else if (thisHlPercent - oHlPercent < 0){
            return -1;
        }else{
            return 0;
        }
    }
}
